#pragma once


enum JobState
{
	JS_NONE,
	JS_QUEUED,
	JS_RUNNING,
	JS_DONE,
	JS_ERROR
};

class CEX Job:public Object
{

	JobState _jobState;
	bool _jobSelfDestruct;

public:

	virtual const char* __getName(){return "Job";}

	Job();
	~Job();

	JobState getJobState();
	void setJobState(JobState js);

	void setJobSelfDestruct(bool sd);
	bool getJobSelfDestruct();

	virtual void onJobStart() = 0;
};



class CEX JobRunner:public Thread
{

public:
	
	virtual const char* __getName(){return "JobRunner";}

	JobRunner();
	~JobRunner();

	void onThreadStart();
};


